package com.rabbit.vo.req;

import com.rabbit.dto.PageInfoDTO;
import com.rabbit.validate.base.Delete;
import com.rabbit.validate.base.Enable;
import com.rabbit.validate.base.Insert;
import com.rabbit.validate.base.Update;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * <h1>字典键值管理相关请求封装</h1>
 *
 * @author zjw
 * @date 2022/02/20 17:38
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DictDataReq extends PageInfoDTO {

    /**
     * 字典键值编号
     */
    @NotNull(message = "字典键值编号不能为空", groups = {Delete.class, Update.class, Enable.class})
    private Long dataId;

    /**
     * 字典标签
     */
    @NotEmpty(message = "字典标签不能为空", groups = {Insert.class, Update.class})
    private String dictLabel;

    /**
     * 字典键值
     */
    @NotEmpty(message = "字典键值不能为空", groups = {Insert.class, Update.class})
    private String dictValue;

    /**
     * 字典类型
     */
    @NotEmpty(message = "字典类型不能为空", groups = {Insert.class, Update.class})
    private String dictType;

    /**
     * 是否默认 (1是 0否)
     */
    @NotNull(message = "是否默认不能为空", groups = {Insert.class, Update.class})
    private Boolean isDefault;

    /**
     * 是否启用 (1启用 0禁用)
     */
    @NotNull(message = "字典键值编号不能为空", groups = {Enable.class})
    private Boolean isEnabled;

    /**
     * 字典排序
     */
    @NotNull(message = "字典排序不能为空", groups = {Insert.class, Update.class})
    private Integer orderNum;

    /**
     * 操作人姓名
     */
    private String operatorUserName;

    /**
     * 字典名称
     */
    private String dictName;

}
